package com.tj.demo.codesnip.designoatten.stategy;

/**
 * @ClassName: DogComprator
 * @Author: TanJun
 * @Date: 2021/5/25 1:05
 * @Description:
 * @Version: 1.0
 * @Copyright: 1
 */
public class DogComprator implements Comparator<Dog> {
    @Override
    public int compara(Dog o1, Dog o2) {
        if(o1.food > o2.food) {
            return 1;
        } else if(o1.food < o2.food) {
            return -1;
        } else {
            return 0;
        }
    }
}
